package com.fashionista;


import java.io.InputStream;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.fashionista.getWeather;

/**
 * A class representing the main page of the application.
 * 
 * @author Tong Wu, Patrick Koperwas, Shayan Yassami, Trevor Adelman
 * @verion for cs48 group project, 3/11/2011
 */
public class HomeActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home);
        
        getWeather current = new getWeather();
        try {
			current.setWeather();
		} catch (Exception e) {
			e.printStackTrace();
		}
	
		//Degree symbol
		char degreeSymbol = '\u00B0';
		
		/*ClothingParser clothingPars = new ClothingParser();
		InputStream inStr = getResources().openRawResource(R.raw.clothing); //and sets the clothing.xml as the file to be used
		clothingPars.parse(inStr); //Parses the xml file
		Integer [] testArray = clothingPars.getJacket("outer");
		*/
		//TextView for large degree display
		TextView degree = (TextView) findViewById(R.id.degrees);
		degree.setText("      " + current.returnDegree() + degreeSymbol);
        
		//TextView for small Fahrenheit and Celcius degrees
		TextView degreeFC = (TextView) findViewById(R.id.degreeF);
		degreeFC.setText("                       " + current.returnDegree() + degreeSymbol + "f   " + current.returnCelDegree() + degreeSymbol + "c");
		
		//TextView for humidity
		TextView humidity = (TextView) findViewById(R.id.humidity);
		humidity.setText("                             Humidity:  " + current.returnHumidity() + " %");
		
		//TextView for Weather Conditions (i.e. Partly Cloudy, Sunny, etc.)
		TextView weatherCond = (TextView) findViewById(R.id.weatherCond);
		weatherCond.setText("                       " + current.returnWeatherCond());
		
		//TextView for Wind speed
		TextView wind = (TextView) findViewById(R.id.windDir);
		wind.setText("                             Wind:  " + current.returnWind());
		
        //Toast.makeText(this, current.returnWeather(), Toast.LENGTH_LONG).show();
		
		//TextView for Event1
		TextView Event1 = (TextView) findViewById(R.id.event1);
		Event1.setText("testing");
    }
}
